<template>
    <el-dialog v-model="dialogVisible" title="" width="600" :before-close="handleClose">
        <div style="color: #000;font-size: 0.2rem;font-weight: 500;">
            <slot> </slot>
        </div>
        <template #footer>
            <div class="dialog-footer">
                <el-button @click="dialogVisible = false">Cancel</el-button>
                <el-button type="primary" @click="onSubmit">
                    Confirm
                </el-button>
            </div>
        </template>
    </el-dialog>
</template>


<script setup>
    import { ref } from 'vue'
    const dialogVisible = ref(false)
    const emits = defineEmits(['submit'])
    const init = () => {
        dialogVisible.value = true
    }
    const onSubmit = () => {
        emits('submit')
        dialogVisible.value = false
    }

    defineExpose({
        init
    })

</script>